/************************************************************************

								Heroes IV
					  Copyright 2001, The 3DO Company

	------------------------------------------------------------------
  							 artifact_set.h

	$Header: $

	$NoKeywords: $

 ************************************************************************/

#ifndef ARTIFACT_SET_H_INCLUDED
#define ARTIFACT_SET_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <bitset>
#include <iosfwd>
#include "artifact_type.h"
#include "handler.h"

class t_artifact_set : public std::bitset<k_artifact_type_count>
{
public:
	t_artifact_set();
	t_artifact_set(std::bitset<k_artifact_type_count> const & source);

	bool read( std::streambuf & stream, bool new_artifact_default = false );

	// Pass in handler to determine what to do about new artifacts
	// added since the set was created
	bool read( std::streambuf& stream, t_handler_2< t_artifact_type, bool & > new_artifact_handler);
	
	bool write( std::streambuf& stream ) const;

private:
	bool read_impl( std::streambuf & stream, int & original_size );
};

// ------------------------------------------------------------------------------
// Inline constructors
// ------------------------------------------------------------------------------
inline t_artifact_set::t_artifact_set()
{
}

inline t_artifact_set::t_artifact_set(std::bitset<k_artifact_type_count> const & source)
	: std::bitset<k_artifact_type_count>(source)
{
}



#endif //ARTIFACT_SET_H_INCLUDED
